from post_json_tool import update_json, print_json
from logger import logger


def main():
    imei = input("请输入IMEI号：")
    start_time_str = input("请输入开始时间（格式为YYYY-MM-DD HH:MM:SS）：")
    channel_time = int(input("请输入一个通道用时（秒）："))
    sleep_cycle = int(input("请输入每个频段的休眠周期（秒）："))
    last_sleep = int(input("请输入最后一个频段的休眠时间设置（秒）："))

    new_dict, end_time = update_json(
        imei, start_time_str, channel_time, sleep_cycle, last_sleep)
    print_json(new_dict, end_time)


if __name__ == "__main__":
    main()
